package s2_threadApi;
/*
* 面试题：线程的排序
* */
public class JoinTest1 {
    public static void main(String[] args) throws Exception
    {
        Thread t1 = new Thread(()->{
            System.out.println("t1");
        });
        Thread t2 = new Thread(()->{
            try {
                t1.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("t2");
        });
        Thread t3 = new Thread(()->{
            try {
                t2.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("t3");
        });
        t1.start();
        t2.start();
        t3.start();

    }
}
